import React from "react";
import * as icons from "@ant-design/icons";
import PropTypes from "prop-types";

export default function IconComponent({ value }) {
  if (!value) return <></>;
  const _model = icons[value];
  return _model ? React.createElement(_model) : <></>;
}

IconComponent.propTypes = {
  value: PropTypes.string.isRequired,
};
